package com.ruoyi.web.wx.service.impl;

import java.util.List;

import com.ruoyi.web.wx.entity.VerificationCode;
import com.ruoyi.web.wx.mapper.VerificationCodeMapper;
import com.ruoyi.web.wx.service.IVerificationCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.core.text.Convert;

/**
 * 验证码 服务层实现
 * 
 * @author ruoyi
 * @date 2019-09-07
 */
@Service
public class VerificationCodeServiceImpl implements IVerificationCodeService
{
	@Autowired
	private VerificationCodeMapper verificationCodeMapper;

	/**
     * 查询验证码信息
     * 
     * @param id 验证码ID
     * @return 验证码信息
     */
    @Override
	public VerificationCode selectVerificationCodeById(String id)
	{
	    return verificationCodeMapper.selectVerificationCodeById(id);
	}
	
	/**
     * 查询验证码列表
     * 
     * @param verificationCode 验证码信息
     * @return 验证码集合
     */
	@Override
	public List<VerificationCode> selectVerificationCodeList(VerificationCode verificationCode)
	{
	    return verificationCodeMapper.selectVerificationCodeList(verificationCode);
	}
	
    /**
     * 新增验证码
     * 
     * @param verificationCode 验证码信息
     * @return 结果
     */
	@Override
	public int insertVerificationCode(VerificationCode verificationCode)
	{
	    return verificationCodeMapper.insertVerificationCode(verificationCode);
	}
	
	/**
     * 修改验证码
     * 
     * @param verificationCode 验证码信息
     * @return 结果
     */
	@Override
	public int updateVerificationCode(VerificationCode verificationCode)
	{
	    return verificationCodeMapper.updateVerificationCode(verificationCode);
	}

	/**
     * 删除验证码对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteVerificationCodeByIds(String ids)
	{
		return verificationCodeMapper.deleteVerificationCodeByIds(Convert.toStrArray(ids));
	}
	
}
